require 'singleton'
require 'yaml'

class Pages

  include Singleton

  def initialize
    load
  end

  def reload
    load
  end

  def get(page_key,item)
    begin
      string = @pages[page_key.to_s][item.to_s]
    rescue
      string = ''
    end
  end

  private

    def load
      @pages = YAML::load(File.open("#{RAILS_ROOT}/config/pages.yml"))
    end

end
